﻿<Window x:Class="SampleTransaq.StopOrdersWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:EcngTradingXaml="clr-namespace:StockSharp.Xaml;assembly=StockSharp.Xaml"
	x:Name="ordersWindow"
    Title="Стоп-заявки" Height="300" Width="870">
	<Window.Resources>
		<EcngTradingXaml:BackgroundConvertor x:Key="myConverter" />

		<Style x:Key="myItemStyle" TargetType="{x:Type ListViewItem}">
			<Setter Property="Background">
				<Setter.Value>
					<Binding RelativeSource="{RelativeSource Self}" Converter="{StaticResource myConverter}"/>
				</Setter.Value>
			</Setter>
		</Style>
	</Window.Resources>
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="*" />
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>

		<ListView x:Name="OrdersDetails" Grid.Column="0" Grid.Row="0" ItemContainerStyle="{StaticResource myItemStyle}" ItemsSource="{Binding ElementName=ordersWindow, Path=Orders}" SelectionChanged="OrdersDetails_SelectionChanged">
			<ListView.View>
				<GridView>
					<GridViewColumn Width="90" Header="Номер" DisplayMemberBinding="{Binding Path=Id}" />
					<GridViewColumn Width="120" Header="Время" DisplayMemberBinding="{Binding Path=Time}" />
					<GridViewColumn Width="70" Header="Цена" DisplayMemberBinding="{Binding Path=Price}" />
					<GridViewColumn Width="80" Header="Стоп Цена" DisplayMemberBinding="{Binding Path=StopPrice}" />
					<GridViewColumn Width="50" Header="Кол-во" DisplayMemberBinding="{Binding Path=Volume}" />
					<GridViewColumn Width="70" Header="Остаток" DisplayMemberBinding="{Binding Path=Balance}" />
					<GridViewColumn Width="70" Header="Операция" DisplayMemberBinding="{Binding Path=Direction}" />
					<GridViewColumn Width="70" Header="Состояние" DisplayMemberBinding="{Binding Path=State}" />
					<GridViewColumn Width="100" Header="Время снятия" DisplayMemberBinding="{Binding Path=CancelTime}" />
					<GridViewColumn Width="120" Header="Производ. заявка" DisplayMemberBinding="{Binding Path=DerivedOrder.Id}" />
				</GridView>
			</ListView.View>
		</ListView>

		<Button x:Name="CancelOrder" Grid.Row="1" Content="Отменить заявку" Width="100" HorizontalAlignment="Right" IsEnabled="False" Click="CancelOrder_Click" />
	</Grid>
</Window>